package com.woniu.microworkorderserver.workgroupmag.mapper;

import com.woniu.microcommonsserver.entity.WorkGroupInfoEntity;
import com.woniu.microcommonsserver.param.PageRequest;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WorkGroupMapper {

    /**
     * 新增数据
     * */
    long save(@Param("w") WorkGroupInfoEntity workGroupInfoEntity);

    /**
     * 分页查询
     * */
    List<WorkGroupInfoEntity> findPage(PageRequest page,
                                       @Param("w") WorkGroupInfoEntity entity);

    /**
     * 删除数据
     * */
    @Delete("delete from work_group_info where id = #{id}")
    void delete(@Param("id") long workGroupId);

    /**
     * 修改数据
     * */
    void update(@Param("w")WorkGroupInfoEntity entity);

    /**
     * 分页查询
     * */
    WorkGroupInfoEntity findById(long id);
}
